package com.atguigu.controller;

import com.atguigu.pojo.User;
import jakarta.servlet.ServletOutputStream;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/12/23 17:17
 * @注释
 */
//@Controller
//@ResponseBody
@RestController
public class TestParamController {

    @RequestMapping("/request/map")
    public String testMap(@RequestBody Map<String, Object> map) {
        System.out.println(map);
        return "success";
    }

    @RequestMapping("/request/pojo")
    public String testParam(User user) {
        System.out.println(user);
        return "success";
    }

//    @RequestMapping("/request/param")
//    public String testRequestParam(
//            Integer id,
//            String username,
//            String password,
//            //@RequestParam List<String> hobby
//            //String hobby
//            String[] hobby
//            ) {
//        System.out.println("id:"+id+",username:"+username+",password:"+password);
//        System.out.println(Arrays.toString(hobby));
//        return "success";
//    }
}
